const { DataTypes } = require('sequelize');
const sequelize = require('../config/db');

const Author = sequelize.define('Author', {
  author_id: {
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false
  },
  introduction: {
    type: DataTypes.TEXT
  },
  level: {
    type: DataTypes.STRING,
    allowNull: false
  },
  is_transcribe: {
    type: DataTypes.BOOLEAN,
    allowNull: false
  },
  message_id: {
    type: DataTypes.INTEGER
  }
}, {
  tableName: 'author',
  timestamps: true,
  createdAt: 'create_at',
  updatedAt: 'update_at'
});

module.exports = Author;